using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.WebTesting;
using WebAndLoadTestPluginsAndRules.Common;
using WebAndLoadTestPluginsAndRules.WebTestPlugins;

namespace HtmlTagInnerTextTests.Common
{
    internal class FakeFilterDependentRequestsPlugin : FilterDependentRequestsPlugin
    {
        private readonly Action<WebTest, string> _addCommentAction;

        public FakeFilterDependentRequestsPlugin(Action<WebTest, string> addCommentAction)
        {
            _addCommentAction = addCommentAction;
        }
        public FakeFilterDependentRequestsPlugin(Action<WebTest, string> addCommentAction, IFilterFactory filterFactory)
            : base (filterFactory)
        {
            _addCommentAction = addCommentAction;
        }

        protected override void AddComment(WebTest webTest, string message)
        {
            _addCommentAction(webTest, message);
        }

        public void TestFilterDependentRequests(WebTest webTest, ICollection<WebTestRequest> dependentRequests, Filter filter, bool addCommentOnRemoval)
        {
            FilterDependentRequests(webTest, dependentRequests, filter, addCommentOnRemoval);
        }

        public new Filter Filter
        {
            get { return base.Filter; }
        }

    }
}